// import { defineConfig } from 'vite'
// import vue from '@vitejs/plugin-vue'
const { defineConfig} = require('vite')
const vue = require('@vitejs/plugin-vue')
const federation = require('@originjs/vite-plugin-federation')

// https://vitejs.dev/config/
module.exports = defineConfig({
  base:"./",
  plugins: [
    vue(),
    federation({
      name: 'module-federation-child',
      filename: 'childEntry.js',
      // 需要暴露的模块
      exposes: {
        './ChildHome': './src/App.vue'
      }
    })
  ],
  build: {
    target: 'es2020', // 针对非行内样式，需要构建规格为 es2020，否则样式会失效，控制台给出提示
    minify: false,
    cssCodeSplit: false,
    rollupOptions: {
      output: {
        minifyInternalExports: false
      }
    }
  }
})
